package ningbo.day04.basic;

/**
 * @Author 宁铂
 * @Date 2021/7/18 9:29
 * @Version 1.0
 */
public class TestFor {
    /** 类用于测试for循环结构
     * */

    public static void main(String[] args) {
        /** 需求：打印100次学习的slogon */
        demoFor();

        /** 需求：打印数字1-10 */
        demoFor2();

        /** 需求：打印数字10-1 */
        demoFor3();

        /** 需求：打印8，88，888，8888 */
        demoFor4();
    }

    private static void demoFor4() {
        for(int i = 8 ; i <= 8888; i = (i*10)+8){
            System.out.print(i+" ");
        }
    }

    private static void demoFor3() {
        for (int i = 10; i >= 1; i--){
            System.out.println(i);
        }
    }

    private static void demoFor2() {
        for (int i = 1; i <= 10; i++){
            System.out.println(i);
        }
    }

    private static void demoFor() {
        for (int i = 1; i <= 100; i++){
            System.out.println("努力复习!!");
        }
    }
}
